package leihua.crm.workbench.service.impl;

import leihua.crm.workbench.domain.Activity;
import leihua.crm.workbench.mapper.ActivityMapper;
import leihua.crm.workbench.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author leiHua
 * @Date 2022/10/7 16:01
 */
@Service
public class ActivityServiceImpl implements ActivityService {
    @Autowired
    private ActivityMapper activityMapper;

    @Override
    public int saveCreateActivity(Activity activity) {
        return activityMapper.insertActivity(activity);
    }

    @Override
    public List<Activity> queryActivityByConditionForPage(Map<String, Object> map) {
        return activityMapper.selectActivityByConditionForPage(map);
    }

    @Override
    public int queryCountOfActivityByCondition(Map<String, Object> map) {
        return activityMapper.selectCountOfActivityByCondition(map);
    }

    @Override
    public int deleteActivityByids(String[] ids) {
        return activityMapper.deleteActivityByIds(ids);
    }

    @Override
    public Activity queryActivityById(String id) {
        return  activityMapper.selectActivityById(id);
    }


    @Override
    public int saveEditActivity(Activity record) {
        return activityMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<Activity> queryAllActivitys() {
        return activityMapper.selectAllActivitys();
    }

    @Override
    public int saveCreateActivityByList(List activityList) {
        return activityMapper.insertActivityList(activityList);
    }

    @Override
    public Activity queryActivityForDatailById(String id) {
        return activityMapper.selectActivityForDatailById(id);
    }

    @Override
    public List<Activity> queryActivityForDetailByClueId(String clueId) {
        return activityMapper.selectActivityForDetailByClueId(clueId);
    }

    @Override
    public List<Activity> queryActivityForDetailByActivityNameAndClueId(Map<String, Object> map) {
        return activityMapper.selectActivityForDetailByActivityNameAndClueId(map);

    }

    @Override
    public List<Activity> queryActivityForConvertByActivityNameAndClueId(Map<String, Object> map) {
        return activityMapper.selectActivityForConvertByActivityNameAndClueId(map);
    }

    @Override
    public List<Activity> queryActivityByActivityName(String activityName) {
        return activityMapper.selectActivityByActivityName(activityName);
    }
}
